package cn.edu.zut.cs.config;

import cn.edu.zut.cs.interceptor.LoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 *  扩展MVC的配置类
 */
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
    //注册自定义拦截器
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new LoginInterceptor())
                .addPathPatterns("/home");
//                .addPathPatterns("/camera")
//                .addPathPatterns("/equipment")
//                .addPathPatterns("/equipment1")
//                .addPathPatterns("/equipment2")
//                .addPathPatterns("/equipment_add")
//                .addPathPatterns("/equipment_modify")
//                .addPathPatterns("/anomalies_alarms")
//                .addPathPatterns("/anomalies_alarms1")
//                .addPathPatterns("/home_panel")
//                .addPathPatterns("/home_panel1")
//                .addPathPatterns("/my_modify")
//                .addPathPatterns("/weight_data")
//                .addPathPatterns("/weight_data1")
//                .addPathPatterns("/modifyUser")
//                .addPathPatterns("/addequipment")
//                .addPathPatterns("/staff_management")
//                .addPathPatterns("/staff_management1");
    }

}
